﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using TA.Turbo;

public partial class SimpleForm_Default : TPage
{
	protected void txt1_ValueChanged(object sender, EventArgs e)
	{
		this.DoPerform();
	}
	protected void txt2_ValueChanged(object sender, EventArgs e)
	{
		this.DoPerform();
	}
	protected void rbOperator_ValueChanged(object sender, EventArgs e)
	{
		this.DoPerform();
	}

	private void DoPerform()
	{
		double o1 = double.Parse(txt1.Value), o2 = double.Parse(txt2.Value), r = 0;
		switch (this.rbOperator.Value)
		{
			case "rbOperatorAdd": r = o1 + o2; break;
			case "rbOperatorSubtract": r = o1 - o2; break;
			case "rbOperatorMultiply": r = o1 * o2; break;
			case "rbOperatorDivide": r = o1 / o2; break;
		}
		txtR.Value = r.ToString();
	}
}
